- project = local_assigns.fetch(:project, nil)
- tag = local_assigns.fetch(:tag, nil)
- return unless project && tag
- title = s_('TagsPage|Delete tag')
- if protected_tag?(project, tag)
  - title = s_('TagsPage|Delete protected tag')
  - if !can?(current_user, :maintainer_access, project)
    - title = s_('TagsPage|Only a project maintainer or owner can delete a protected tag')
    - disabled = true

= render Pajamas::ButtonComponent.new(variant: :default, icon: 'remove', button_options: { class: "js-delete-tag-button", 'aria-label': s_('TagsPage|Delete tag'), title: title, disabled: disabled, data: { toggle: 'tooltip', container: 'body', path: project_tag_path(@project, tag.name), tag_name: tag.name, is_protected: protected_tag?(project, tag).to_s } })
